add_rules("mode.debug", "mode.release")

package("dpdk")
    set_sourcedir(path.join(os.scriptdir(), "3rd/dpdk"))
    add_links("dpdk_add")
    add_linkgroups("dpdk_add", {name = "dpdk", whole = true, group = true})
    on_install("linux", function (package)
        import("package.tools.xmake").install(package)
    end)
    on_test(function (package)
        assert(package:has_cxxincludes("add.h"))
    end)
package_end()

package("spdk")
    set_sourcedir(path.join(os.scriptdir(), "3rd/spdk"))
    add_deps("dpdk")
    add_links("spdk_mul")
    add_linkgroups("spdk_mul", {name = "dpdk", whole = true, group = true})
    on_install("linux", function (package)
        import("package.tools.xmake").install(package)
    end)
    on_test(function (package)
        assert(package:has_cxxincludes("mul.h"))
    end)
package_end()

add_requires("spdk")

target("test")
    set_kind("binary")
    add_files("src/main.cc")
    add_packages("spdk")
    add_includedirs("src")

